<div>
    <button type="button" class="btn btn-xs btn-info" data-status="0" onclick="RealWorking(this)">
    查看工况
    </button>
</div>
<script>
    function RealWorking(ele){
        if ($(ele).attr("data-status") == 0) {
            $(ele).html("停止工况").attr("data-status", 1);
            if (!(em.TermCode == "undefined" || em.TermCode == "" || em.TermCode == "-")) {
                callSvr("eqpt/getRealWorking",{"termCode":"PT17060001"},function(data){
                    console.log(JSON.stringify(data));
                });
            }
        } else {
            $(ele).html("查看工况").attr("data-status", 0);
            callSvr("eqpt/getRealWorking",{"termCode":"PT17060001","end":0},function(data){
                console.log(JSON.stringify(data));
            });
        }
    }
</script>